package admin

import (
	"github.com/gogf/gf/v2/frame/g"
	"time"
)

type LoginReq struct {
	g.Meta `method:"get"  tags:"login" summary:"login api"`
}
type LoginRes struct {
}

// LoginDoReq 根据路由后缀.do区分是否是异步请求
type LoginDoReq struct {
	g.Meta   `method:"post"  tags:"login" summary:"login api"`
	UserName string `p:"username" v:"required|length:5,30#请输入登录账号|账号长度为：min-max位"`
	Password string `p:"password" v:"required#请输入密码"`
	Captcha  string `p:"captcha" v:"length:4,6#请输入验证码|验证码长度不够"`
	IdKey    string `p:"idkey" v:""`
}
type LoginDoRes struct {
	g.Meta   `mime:"application/json"`
	Token    string         `json:"token"`
	Expire   time.Time      `json:"expire"`
	UserInfo UserInfoSimple `json:"userInfo"`
}
type UserInfoSimple struct {
	UserName string `json:"userName"     ` // 用户名
	RealName string `json:"realName"     ` // 真实姓名
	Email    string `json:"email"        ` // 邮箱
	Phone    string `json:"phone"        ` // 手机号
}
type LogoutReq struct {
	g.Meta `method:"get" `
}
type LogoutRes struct {
}
